<template>
	<view v-if="info" class="details">
		<view class="sameBox">
			<view class="name u-m-b-10">
				<text>{{info.realName}}</text>
				<text class="u-m-l-8">{{info.mobile}}</text>
			</view>
			<view class="addr" >
				<image style="margin-top: 5rpx;" class="addrIcon" src="https://oss.6mate.cn/mini/addrIcon.png" mode="">
				</image>
				<view>
					{{info.province}}{{info.city}}
					
				</view>
			</view>
			<view class="same">
				<view class="label">
					微信号
				</view>
				<view class="value">
					{{info.weiXin}}
				</view>
			</view>
			<view v-if="info.gender" class="same">
				<view class="label">
					性别
				</view>
				<view class="value">
					{{info.genderName}}
				</view>
			</view>
			<view  v-if="info.birthday" class="same">
				<view class="label">
					生日
				</view>
				<view class="value">
					{{info.birthday}}
				</view>
			</view>
			<view class="same">
				<view class="label">
					证件类型
				</view>
				<view class="value">
					{{info.certificateTypeName}}
				</view>
			</view>
			<view class="same">
				<view class="label">
					证件号
				</view>
				<view class="value">
					{{info.certificateNo}}
				</view>
			</view>
			<view class="same">
				<view class="label">
					备注
				</view>
				<view class="value">
					{{info.description}}
				</view>
			</view>
			<view class="same">
				<view class="label">
					详细地址
				</view>

				<view class="value addrDetail">
					 {{info && info.address}}
					 <!-- 2222222222222222222222222222222222222222222 -->
				</view>
			</view>
			
			
			
			<view v-if="ewmImg.length" class="same">
				<view class="label">
					个人二维码
				</view>
				
			</view>
			<view v-if="ewmImg.length" class="">
				<u-upload :disabled="false" :deletable="false" :width="148" :height="148" :show-progress="false"
					:max-count="ewmImg.length" :file-list="ewmImg"></u-upload>
			</view>
			
			
			<view v-if="showImageList.length" class="same">
				<view class="label">
					附件
				</view>
				
			</view>
			<view v-if="showImageList.length" class="">
				<u-upload :disabled="false" :deletable="false" :width="148" :height="148" :show-progress="false"
					:max-count="showImageList.length" :file-list="showImageList"></u-upload>
			</view>
		</view>
		<view class="sameBox">
			<!-- <view v-if="info.orderNo" class="name u-m-b-10">
				<text>订单编号</text>
				<text class="code">{{info.orderNo}}</text>
			</view> -->
			
			<view v-if="info.orderNo" class="same">
				<view class="label">
					订单编号
				</view>
				<view class="value">
					{{info.orderNo}}
				</view>
			</view>

			<view v-if="info.genTime" class="same">
				<view class="label">
					生成时间
				</view>
				<view class="value">
					{{info.genTime}}
				</view>
			</view>
			<view v-if="info.checkerName" class="same">
				<view class="label">
					审核人
				</view>
				<view class="value">
					{{info.checkerName}}
				</view>
			</view>
			<view v-if="info.checkTime" class="same">
				<view class="label">
					审核时间
				</view>
				<view class="value">
					{{info.checkTime}}
				</view>
			</view>
			<view v-if="info.note" class="same">
				<view class="label">
					审核备注
				</view>
				<view class="value">
					{{info.note}}
				</view>
			</view>
			<view class="same">

				<view class="label">
					状态
				</view>
				<view class="value">
					<text v-if="info.flowStatus=='NEW'" class="status add">
						{{info.flowStatusName}}
					</text>
					<text v-else-if="info.flowStatus=='APPLIED'" class="status doing">
						{{info.flowStatusName}}
					</text>
					<text v-else-if="info.flowStatus=='REJECTED'" class="status">
						{{info.flowStatusName}}
					</text>
					<text v-else class="status ok">
						{{info.flowStatusName}}
					</text>
				</view>
			</view>
		</view>
		<view class="sameBox">
			<view class="money">
				<view class="moneyTit">
					应付金额
				</view>
				<view class="moneyVal">
					<text>¥</text>
					{{info.totalPayableAmount}}
				</view>
			</view>
		</view>
		<view v-if="info.flowStatus=='NEW'" class="btnFix">
			<view @click="edit(info)" class="edit">
				修改
			</view>
			<view class="sub">
				<u-button style="width: 100%;" shape="circle" type="error" @click="submit" :ripple="true" ripple-bg-color="#d7d8da">提交审核
				</u-button>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				showImageList: [{
					url: 'https://oss.6mate.cn/mini/narrow.png'
				}],
				ewmImg:[],
				info:null,
				id:''
			}
		},
		onLoad(e) {
			this.getDetail(e?.id)
			this.id = e.id
			
		},
		methods: {
			getDetail(id){
				this.$u.api.joinOrderDetail({
					id
				})
					.then(res => {
						if (res.code == 'ok') {
							this.info = res.data
							this.showImageList = this.info?.imageList?.map(r=>{
								return{
									url:r
								}
							})
							this.ewmImg =this.info?.weiXinImageUrl?[{url:this.info?.weiXinImageUrl}]:[]
						}else{
							uni.showToast({
								icon:"none",
								title:res.msg,
								duration:3000
							})
						}
						
						
					});
			},
			
			edit(info){
				uni.navigateTo({
					url:"/teamPack/teamManage/index?id="+info?.id
				})
			},
			
			submit() {
				
				this.$u.api.joinOrderCommit({
					id:this.id
				})
				.then(res => {
					if (res.code == 'ok') {
						uni.redirectTo({
							url:"/teamPack/joinRecord/index?tab=1"
						})
						
					}else{
						uni.showToast({
							icon:"none",
							title:res.msg,
							duration:3000
						})
					}
				});

			}
		}
	}
</script>

<style>
	page {
		background: #F6F6F6;
	}
</style>
<style scoped lang="scss">
	.addrDetail{
		word-break: break-all;
		align-items: flex-start;
	}
	.btnFix {
		padding-bottom: calc(68rpx + env(safe-area-inset-bottom));
		display: flex;
		align-items: center;
		justify-content: space-between;
		position: fixed;
		bottom: 0;
		left: 40rpx;
		right: 40rpx;

		.edit {
			font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
			font-weight: 400;
			font-size: 28rpx;
			color: #0F1417;
			line-height: 44rpx;
			display: flex;
			align-items: center;
			justify-content: center;
			width: 308rpx;
			height: 80rpx;
			background: #FFFFFF;
			border-radius: 40rpx 40rpx 40rpx 40rpx;
			box-shadow: 0rpx 20rpx 24rpx 0rpx rgba(190,190,190,0.2);
		}

		.sub {
			width: 308rpx;
			height: 80rpx;
			// background: #FA4A53;
			box-shadow: 0rpx 20rpx 24rpx 0rpx rgba(181, 36, 44, 0.2);
			border-radius: 40rpx 40rpx 40rpx 40rpx;
		}
	}

	.details {
		margin: 24rpx 40rpx 0;
		padding-bottom: 150rpx;

		.sameBox {
			background: #FFFFFF;
			border-radius: 16rpx 16rpx 16rpx 16rpx;
			margin-bottom: 24rpx;
			padding: 24rpx;

			.money {
				display: flex;
				align-items: center;
				justify-content: space-between;

				.moneyTit {
					font-family: Alibaba PuHuiTi, Alibaba PuHuiTi;
					font-weight: 500;
					font-size: 28rpx;
					color: #0F1417;
					line-height: 33rpx;
				}

				.moneyVal {
					font-family: Alibaba PuHuiTi, Alibaba PuHuiTi;
					font-weight: 500;
					font-size: 32rpx;
					color: #FA4A53;
					line-height: 33rpx;

					text {
						font-size: 28rpx;
					}
				}
			}

			.addr {
				display: flex;
				align-items: center;
				margin-bottom: 24rpx;

				.addrIcon {
					margin-right: 10rpx;
					width: 24rpx;
					height: 24rpx;
				}
			}

			.name {
				font-family: Alibaba PuHuiTi, Alibaba PuHuiTi;
				font-weight: 500;
				font-size: 32rpx;
				color: #0F1417;
				line-height: 38rpx;

				.code {
					font-family: Alibaba PuHuiTi, Alibaba PuHuiTi;
					font-weight: 500;
					font-size: 24rpx;
					color: #0F1417;
					line-height: 28rpx;
				}
			}

			.same {
				display: flex;
				align-items: flex-start;
				margin-bottom: 16rpx;

				.label {
					min-width: 112rpx;
					height: 38rpx;
					font-family: Alibaba PuHuiTi, Alibaba PuHuiTi;
					font-weight: 400;
					font-size: 28rpx;
					color: #0F1417;
					margin-right: 70rpx;

					.value {
						font-family: Alibaba PuHuiTi, Alibaba PuHuiTi;
						font-weight: 400;
						font-size: 28rpx;
						color: rgba(15, 20, 23, 0.6);
						line-height: 33rpx;

						
					}
				}



			}
		}
		
		.status {
		
			color: #6F7274;
		
			&.add {
				color: rgba(23, 103, 222, 1) !important;
			}
		
			&.doing {
				color: #FFA340 !important;
			}
		
			&.ok {
				color: #1BAB6B !important;
			}
		}
	}
</style>
